#ifndef MATWIN_H
#define MATWIN_H

#include <QWidget>
#include "matwin_global.h"
#include "mat.h"

class MatItem;
class MatScene;
class QGraphicsView;

class MATWINSHARED_EXPORT MatWin : public QWidget
{
    Q_OBJECT
public:
    MatWin(const Mat &mat, QWidget *parent = 0);
    MatWin(qint32 m, qint32 n, qreal size, QWidget *parent = 0);
    virtual ~MatWin();

    MatItem *itemAt(qint32 m, qint32 n);
    void setItemsColor(qint32 type, const QColor &color);

    Mat mat() const { return m_mat; }
    qint32 m() const { return m_mat.m(); }
    qint32 n() const { return m_mat.n(); }

private:
    void initUi(const Mat &mat);

    Mat m_mat;

    MatScene *m_matScene;
    QGraphicsView *m_graphView;

    Q_DISABLE_COPY(MatWin)
};

#endif // MATWIN_H
